import  { defineStore } from "pinia";

const userStore = defineStore('userInfo', {
    state: () => {
        return {
            nickName: 'jack',
            job: 'duck',
            map: [],
            polygonArray: [],
            AMap: []
        };
    },
    getters: {
        editName(state) {
            return state.nickName + '1'
        },
        secondEditName() {
            return this.editName + '2'
        }
    },
    actions: {
        handleStateAction() {
            this.nickName = 'safe'
            this.job = 'kill'
        }
    }
});

export default userStore
